<!-- 采购订单物料入库 -->

<script setup>
import { ref, inject } from 'vue'

//响应值
const value1 = ref('')
const input = ref('')
//测试数据
const testdata=[{
  "index":"E47638432",
  "name":"六方铜螺钉",
  "number1":"50",
  "number2":"0",
  "time":"2019-03-21 11:23:15"
}]

//当前的采购订单
const currentBin = inject("currentBin")
console.log("currentBin")
console.log(currentBin)

//入库库位测试值，后续可用数据库连接
const options = [
  {
    value: 'KW-A130101',
    label: 'KW-A130101',
  },
  {
    value: 'KW-A130102',
    label: 'KW-A130102',
  },
  {
    value: 'KW-A130103',
    label: 'KW-A130103',
  },
  {
    value: 'KW-A130104',
    label: 'KW-A130104',
  },
  {
    value: 'KW-A130105',
    label: 'KW-A130105',
  },
]
</script>
<template>
 <!-- 功能栏 -->
  <!-- 表单名称 -->
  <el-row style="background-color:white;margin:10px 10px 0 10px">
    <el-col :span="10" style="margin:10px 0 0 10px">【{{ currentBin }}】 物料入库</el-col>
  </el-row>
  <!-- 表单主体 -->
  <el-row style="background-color:white;margin:0 10px 0 10px">
    <el-col :span="24" style="margin-top:15px">
      <!--:data为测试数据，可对应数据库修改  stripe斑马纹效果 border带边框 -->
      <el-table :data="testdata" stripe border style="width:100%">
        <!-- 定义列表属性 prop值可对于数据库字段名修改-->
        <el-table-column label="物料编号" align="center" prop="index" :index="indexMethod" width="180px" />
            <el-table-column label="物料名称" align="center" prop="name" width="180px" />
            <el-table-column label="计划采购数量" align="center" prop="number1" width="150px" />
            <el-table-column label="剩余可采购数量" align="center" prop="number2" width="150px" />
            <el-table-column label="入库库位" align="center" width="200px"> 
              <el-select  placeholder="选择库位" v-model="value1">
                <el-option
                  v-for="item in options"
                 :key="item.value"
                 :label="item.label"
                 :value="item.value"
                />
              </el-select>
            </el-table-column>
           <el-table-column label="入库数量" align="center" width="200px">
              <el-input v-model="input" placeholder="请输入物料入库数量"/>
           </el-table-column>
           <el-table-column label="操作" align="center">
            <el-button type="success">立即入库</el-button>
           </el-table-column>
      </el-table>
    </el-col>
  </el-row>
</template>
<style scoped>

</style>